/**
 * Created by Administrator on 2016/8/2.
 */
"use strict";
swan_pc
    .directive("friendSelect",function(getMyFriend){
        return{
            restrict:"AE",
            templateUrl:"scripts/services/directive/friendselect/friendSelect.html",
            scope:{
                selectType:"@"
            },
            controller:["$scope",function($scope){
                $scope.firendWhoSendMePermission=[];
                getMyFriend.query(function(result){
                    $scope.firendWhoSendMePermission=result;
                    $scope.changeSelectedFriend=function(id){
                        //console.log("changeSelectedRun"+id);
                        $scope.selectResult=id;
                        $scope.$parent.selectFriendId=$scope.selectResult;
                    }
                    $scope.checkShow=function(id){
                        //console.log(id+"    "+$scope.selectResult);
                        if(id==$scope.selectResult){
                            return true;
                        }else{
                            return false;
                        }
                    }
                })
            }]
        }
    })
